/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * VistaAdministracion.java
 *
 * Created on 09/07/2009, 18:19:00
 */

package administracion;

import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPasswordField;
import javax.swing.JTextField;

import map.CasillaDAO;
import map.ConfianzaDAO;
import map.ConfigDAO;
import map.OficinaCorreoDAO;
import map.RelacionCasillasOficinasDAO;
import map.UsuariosDAO;

import com.sun.xml.internal.ws.api.server.Container;


/**
 *
 * @author gabi
 */
public class VistaAdministracion extends javax.swing.JFrame {

    /** Creates new form VistaAdministracion */
    public VistaAdministracion() {
        initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jTabbedPane1 = new javax.swing.JTabbedPane();
        usuariosPanel = new javax.swing.JPanel();
        usuarioLbl = new javax.swing.JLabel();
        usuarioTxt = new javax.swing.JTextField();
        crearUsuarioBtn = new javax.swing.JButton();
        borrarUsuarioBtn = new javax.swing.JButton();
        oficinasPanel = new javax.swing.JPanel();
        oficinaLbl = new javax.swing.JLabel();
        oficinaTxt = new javax.swing.JTextField();
        crearOficinaBtn = new javax.swing.JButton();
        borrarOficinaBtn = new javax.swing.JButton();
        confianzasPanel = new javax.swing.JPanel();
        oficina1Lbl = new javax.swing.JLabel();
        oficina1Txt = new javax.swing.JTextField();
        crearConfianzaBtn = new javax.swing.JButton();
        borrarConfianzaBtn = new javax.swing.JButton();
        oficina2Lbl = new javax.swing.JLabel();
        oficina2Txt = new javax.swing.JTextField();
        relacionesPanel = new javax.swing.JPanel();
        casillaRelacLbl = new javax.swing.JLabel();
        casillaRelacTxt = new javax.swing.JTextField();
        crearRelacBtn = new javax.swing.JButton();
        borrarRelacBtn = new javax.swing.JButton();
        oficinaRelacLbl = new javax.swing.JLabel();
        oficinaRelacTxt = new javax.swing.JTextField();
        casillasPanel = new javax.swing.JPanel();
        casillaLbl = new javax.swing.JLabel();
        casillaTxt = new javax.swing.JTextField();
        crearCasillaBtn = new javax.swing.JButton();
        borrarCasillaBtn = new javax.swing.JButton();
        casillaUsuarioLbl = new javax.swing.JLabel();
        casillaUsuarioTxt = new javax.swing.JTextField();
        passLbl = new javax.swing.JLabel();
        passTxt = new javax.swing.JPasswordField();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Administracion");

        usuarioLbl.setText("Usuario:");

        usuarioTxt.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                usuarioTxtActionPerformed(evt);
            }
        });

        crearUsuarioBtn.setText("Crear");
        crearUsuarioBtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                crearUsuarioBtnActionPerformed(evt);
            }
        });

        borrarUsuarioBtn.setText("Borrar");
        borrarUsuarioBtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                borrarUsuarioBtnActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout usuariosPanelLayout = new javax.swing.GroupLayout(usuariosPanel);
        usuariosPanel.setLayout(usuariosPanelLayout);
        usuariosPanelLayout.setHorizontalGroup(
            usuariosPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(usuariosPanelLayout.createSequentialGroup()
                .addGroup(usuariosPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(usuariosPanelLayout.createSequentialGroup()
                        .addGap(32, 32, 32)
                        .addComponent(crearUsuarioBtn, javax.swing.GroupLayout.PREFERRED_SIZE, 89, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(187, 187, 187)
                        .addComponent(borrarUsuarioBtn, javax.swing.GroupLayout.PREFERRED_SIZE, 91, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(usuariosPanelLayout.createSequentialGroup()
                        .addGap(72, 72, 72)
                        .addComponent(usuarioLbl)
                        .addGap(29, 29, 29)
                        .addComponent(usuarioTxt, javax.swing.GroupLayout.PREFERRED_SIZE, 194, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(35, Short.MAX_VALUE))
        );
        usuariosPanelLayout.setVerticalGroup(
            usuariosPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(usuariosPanelLayout.createSequentialGroup()
                .addGap(98, 98, 98)
                .addGroup(usuariosPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(usuarioLbl)
                    .addComponent(usuarioTxt, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 83, Short.MAX_VALUE)
                .addGroup(usuariosPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(borrarUsuarioBtn, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(crearUsuarioBtn, javax.swing.GroupLayout.DEFAULT_SIZE, 35, Short.MAX_VALUE))
                .addGap(22, 22, 22))
        );

        jTabbedPane1.addTab("Usuario", usuariosPanel);

        oficinaLbl.setText("Oficina de Correo:");

        oficinaTxt.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                oficinaTxtActionPerformed(evt);
            }
        });

        crearOficinaBtn.setText("Crear");
        crearOficinaBtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                crearOficinaBtnActionPerformed(evt);
            }
        });

        borrarOficinaBtn.setText("Borrar");
        borrarOficinaBtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                borrarOficinaBtnActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout oficinasPanelLayout = new javax.swing.GroupLayout(oficinasPanel);
        oficinasPanel.setLayout(oficinasPanelLayout);
        oficinasPanelLayout.setHorizontalGroup(
            oficinasPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(oficinasPanelLayout.createSequentialGroup()
                .addGroup(oficinasPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(oficinasPanelLayout.createSequentialGroup()
                        .addGap(32, 32, 32)
                        .addComponent(crearOficinaBtn, javax.swing.GroupLayout.PREFERRED_SIZE, 89, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(187, 187, 187)
                        .addComponent(borrarOficinaBtn, javax.swing.GroupLayout.PREFERRED_SIZE, 91, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(oficinasPanelLayout.createSequentialGroup()
                        .addGap(24, 24, 24)
                        .addComponent(oficinaLbl)
                        .addGap(26, 26, 26)
                        .addComponent(oficinaTxt, javax.swing.GroupLayout.PREFERRED_SIZE, 196, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(35, Short.MAX_VALUE))
        );
        oficinasPanelLayout.setVerticalGroup(
            oficinasPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(oficinasPanelLayout.createSequentialGroup()
                .addGap(98, 98, 98)
                .addGroup(oficinasPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(oficinaLbl)
                    .addComponent(oficinaTxt, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 83, Short.MAX_VALUE)
                .addGroup(oficinasPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(borrarOficinaBtn, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(crearOficinaBtn, javax.swing.GroupLayout.DEFAULT_SIZE, 35, Short.MAX_VALUE))
                .addGap(22, 22, 22))
        );

        jTabbedPane1.addTab("Oficina Correo", oficinasPanel);

        oficina1Lbl.setText("Oficina1");

        oficina1Txt.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                oficina1TxtActionPerformed(evt);
            }
        });

        crearConfianzaBtn.setText("Crear");
        crearConfianzaBtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                crearConfianzaBtnActionPerformed(evt);
            }
        });

        borrarConfianzaBtn.setText("Borrar");
        borrarConfianzaBtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                borrarConfianzaBtnActionPerformed(evt);
            }
        });

        oficina2Lbl.setText("Oficina2");

        oficina2Txt.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                oficina2TxtActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout confianzasPanelLayout = new javax.swing.GroupLayout(confianzasPanel);
        confianzasPanel.setLayout(confianzasPanelLayout);
        confianzasPanelLayout.setHorizontalGroup(
            confianzasPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(confianzasPanelLayout.createSequentialGroup()
                .addGroup(confianzasPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(confianzasPanelLayout.createSequentialGroup()
                        .addGap(32, 32, 32)
                        .addComponent(crearConfianzaBtn, javax.swing.GroupLayout.PREFERRED_SIZE, 89, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(187, 187, 187)
                        .addComponent(borrarConfianzaBtn, javax.swing.GroupLayout.PREFERRED_SIZE, 91, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(confianzasPanelLayout.createSequentialGroup()
                        .addGap(72, 72, 72)
                        .addGroup(confianzasPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(oficina1Lbl)
                            .addComponent(oficina2Lbl))
                        .addGap(29, 29, 29)
                        .addGroup(confianzasPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(oficina2Txt, javax.swing.GroupLayout.PREFERRED_SIZE, 194, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(oficina1Txt, javax.swing.GroupLayout.PREFERRED_SIZE, 194, javax.swing.GroupLayout.PREFERRED_SIZE))))
                .addContainerGap(35, Short.MAX_VALUE))
        );
        confianzasPanelLayout.setVerticalGroup(
            confianzasPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(confianzasPanelLayout.createSequentialGroup()
                .addGap(98, 98, 98)
                .addGroup(confianzasPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(oficina1Lbl)
                    .addComponent(oficina1Txt, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(confianzasPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(oficina2Txt, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(oficina2Lbl))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 45, Short.MAX_VALUE)
                .addGroup(confianzasPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(borrarConfianzaBtn, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(crearConfianzaBtn, javax.swing.GroupLayout.DEFAULT_SIZE, 35, Short.MAX_VALUE))
                .addGap(22, 22, 22))
        );

        jTabbedPane1.addTab("Confianza", confianzasPanel);

        casillaRelacLbl.setText("Casilla");

        casillaRelacTxt.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                casillaRelacTxtActionPerformed(evt);
            }
        });

        crearRelacBtn.setText("Crear");
        crearRelacBtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                crearRelacBtnActionPerformed(evt);
            }
        });

        borrarRelacBtn.setText("Borrar");
        borrarRelacBtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                borrarRelacBtnActionPerformed(evt);
            }
        });

        oficinaRelacLbl.setText("Oficina");

        oficinaRelacTxt.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                oficinaRelacTxtActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout relacionesPanelLayout = new javax.swing.GroupLayout(relacionesPanel);
        relacionesPanel.setLayout(relacionesPanelLayout);
        relacionesPanelLayout.setHorizontalGroup(
            relacionesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(relacionesPanelLayout.createSequentialGroup()
                .addGap(32, 32, 32)
                .addComponent(crearRelacBtn, javax.swing.GroupLayout.PREFERRED_SIZE, 89, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(187, 187, 187)
                .addComponent(borrarRelacBtn, javax.swing.GroupLayout.PREFERRED_SIZE, 91, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(35, Short.MAX_VALUE))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, relacionesPanelLayout.createSequentialGroup()
                .addContainerGap(73, Short.MAX_VALUE)
                .addGroup(relacionesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(relacionesPanelLayout.createSequentialGroup()
                        .addComponent(oficinaRelacLbl)
                        .addGap(18, 18, 18)
                        .addComponent(oficinaRelacTxt, javax.swing.GroupLayout.PREFERRED_SIZE, 194, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(relacionesPanelLayout.createSequentialGroup()
                        .addComponent(casillaRelacLbl)
                        .addGap(18, 18, 18)
                        .addComponent(casillaRelacTxt, javax.swing.GroupLayout.PREFERRED_SIZE, 194, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addGap(116, 116, 116))
        );
        relacionesPanelLayout.setVerticalGroup(
            relacionesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(relacionesPanelLayout.createSequentialGroup()
                .addGap(57, 57, 57)
                .addGroup(relacionesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(casillaRelacTxt, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(casillaRelacLbl))
                .addGap(29, 29, 29)
                .addGroup(relacionesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(oficinaRelacTxt, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(oficinaRelacLbl))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 75, Short.MAX_VALUE)
                .addGroup(relacionesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(borrarRelacBtn, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(crearRelacBtn, javax.swing.GroupLayout.DEFAULT_SIZE, 35, Short.MAX_VALUE))
                .addGap(22, 22, 22))
        );

        jTabbedPane1.addTab("Relaciones", relacionesPanel);

        casillaLbl.setText("Casilla");

        casillaTxt.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                casillaTxtActionPerformed(evt);
            }
        });

        crearCasillaBtn.setText("Crear");
        crearCasillaBtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                crearCasillaBtnActionPerformed(evt);
            }
        });

        borrarCasillaBtn.setText("Borrar");
        borrarCasillaBtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                borrarCasillaBtnActionPerformed(evt);
            }
        });

        casillaUsuarioLbl.setText("Casilla Usuario");

        casillaUsuarioTxt.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                casillaUsuarioTxtActionPerformed(evt);
            }
        });

        passLbl.setText("Password");

        javax.swing.GroupLayout casillasPanelLayout = new javax.swing.GroupLayout(casillasPanel);
        casillasPanel.setLayout(casillasPanelLayout);
        casillasPanelLayout.setHorizontalGroup(
            casillasPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(casillasPanelLayout.createSequentialGroup()
                .addGap(32, 32, 32)
                .addComponent(crearCasillaBtn, javax.swing.GroupLayout.PREFERRED_SIZE, 89, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(187, 187, 187)
                .addComponent(borrarCasillaBtn, javax.swing.GroupLayout.PREFERRED_SIZE, 91, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(35, Short.MAX_VALUE))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, casillasPanelLayout.createSequentialGroup()
                .addContainerGap(34, Short.MAX_VALUE)
                .addGroup(casillasPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(casillasPanelLayout.createSequentialGroup()
                        .addComponent(casillaUsuarioLbl)
                        .addGap(27, 27, 27)
                        .addComponent(casillaUsuarioTxt, javax.swing.GroupLayout.PREFERRED_SIZE, 194, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(casillasPanelLayout.createSequentialGroup()
                        .addGroup(casillasPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(passLbl)
                            .addComponent(casillaLbl))
                        .addGap(27, 27, 27)
                        .addGroup(casillasPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(passTxt)
                            .addComponent(casillaTxt, javax.swing.GroupLayout.DEFAULT_SIZE, 194, Short.MAX_VALUE))))
                .addGap(110, 110, 110))
        );
        casillasPanelLayout.setVerticalGroup(
            casillasPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(casillasPanelLayout.createSequentialGroup()
                .addGap(45, 45, 45)
                .addGroup(casillasPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(casillaTxt, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(casillaLbl))
                .addGap(27, 27, 27)
                .addGroup(casillasPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(passLbl)
                    .addComponent(passTxt, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 28, Short.MAX_VALUE)
                .addGroup(casillasPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(casillaUsuarioTxt, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(casillaUsuarioLbl))
                .addGap(41, 41, 41)
                .addGroup(casillasPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(borrarCasillaBtn, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(crearCasillaBtn, javax.swing.GroupLayout.DEFAULT_SIZE, 35, Short.MAX_VALUE))
                .addGap(22, 22, 22))
        );

        jTabbedPane1.addTab("Casillas", casillasPanel);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jTabbedPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 439, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jTabbedPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 283, Short.MAX_VALUE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void usuarioTxtActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_usuarioTxtActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_usuarioTxtActionPerformed

    private void crearUsuarioBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_crearUsuarioBtnActionPerformed
        // TODO add your handling code here:
        new UsuariosDAO().addUsuario(usuarioTxt.getText());
	usuarioTxt.setText("");
    }//GEN-LAST:event_crearUsuarioBtnActionPerformed

    private void borrarUsuarioBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_borrarUsuarioBtnActionPerformed
        // TODO add your handling code here:
        new UsuariosDAO().delUsuario(usuarioTxt.getText());
	usuarioTxt.setText("");
    }//GEN-LAST:event_borrarUsuarioBtnActionPerformed

    private void oficinaTxtActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_oficinaTxtActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_oficinaTxtActionPerformed

    private void crearOficinaBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_crearOficinaBtnActionPerformed
        // TODO add your handling code here:
        new OficinaCorreoDAO().altaOficinaCorreo(oficinaTxt.getText());
	oficinaTxt.setText("");
    }//GEN-LAST:event_crearOficinaBtnActionPerformed

    private void borrarOficinaBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_borrarOficinaBtnActionPerformed
        // TODO add your handling code here:
        new OficinaCorreoDAO().bajaOficinaCorreo(oficinaTxt.getText());
	oficinaTxt.setText("");
    }//GEN-LAST:event_borrarOficinaBtnActionPerformed

    private void oficina1TxtActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_oficina1TxtActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_oficina1TxtActionPerformed

    private void crearConfianzaBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_crearConfianzaBtnActionPerformed
        // TODO add your handling code here:
       	/**
	 * Tener en cuenta que para crear las relaciones de confianza
	 * tengo que utilizar el metodo altaConfianza que se encuentra
	 * en ConfianzaDAO, esto es antes de utilizar la demostracion.
	 * GM
	 * */
	new ConfianzaDAO().confianzaHabilitar(oficina1Txt.getText(), oficina2Txt.getText());
	oficina1Txt.setText("");
	oficina2Txt.setText("");
    }//GEN-LAST:event_crearConfianzaBtnActionPerformed

    private void borrarConfianzaBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_borrarConfianzaBtnActionPerformed
        // TODO add your handling code here:
        new ConfianzaDAO().bajaConfianza(oficina1Txt.getText(), oficina2Txt.getText());
	oficina1Txt.setText("");
	oficina2Txt.setText("");
    }//GEN-LAST:event_borrarConfianzaBtnActionPerformed

    private void casillaRelacTxtActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_casillaRelacTxtActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_casillaRelacTxtActionPerformed

    private void crearRelacBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_crearRelacBtnActionPerformed
        // TODO add your handling code here:
        new RelacionCasillasOficinasDAO().altaRelCasillaOficina(casillaRelacTxt.getText(), oficinaRelacTxt.getText());
	casillaRelacTxt.setText("");
	oficinaRelacTxt.setText("");
    }//GEN-LAST:event_crearRelacBtnActionPerformed

    private void borrarRelacBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_borrarRelacBtnActionPerformed
        // TODO add your handling code here:
        new RelacionCasillasOficinasDAO().bajaRelCasillaOficina(casillaRelacTxt.getText(), oficinaRelacTxt.getText());
	casillaRelacTxt.setText("");
	oficinaRelacTxt.setText("");
    }//GEN-LAST:event_borrarRelacBtnActionPerformed

    private void casillaTxtActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_casillaTxtActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_casillaTxtActionPerformed

    private void crearCasillaBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_crearCasillaBtnActionPerformed
        // TODO add your handling code here:
        new CasillaDAO().altaCasilla(casillaTxt.getText(), passTxt.getText(), casillaUsuarioTxt.getText());
	casillaTxt.setText("");
	passTxt.setText("");
	casillaUsuarioTxt.setText("");
    }//GEN-LAST:event_crearCasillaBtnActionPerformed

    private void borrarCasillaBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_borrarCasillaBtnActionPerformed
        // TODO add your handling code here:
        new CasillaDAO().bajaCasilla(casillaTxt.getText());
    }//GEN-LAST:event_borrarCasillaBtnActionPerformed

    private void oficina2TxtActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_oficina2TxtActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_oficina2TxtActionPerformed

    private void oficinaRelacTxtActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_oficinaRelacTxtActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_oficinaRelacTxtActionPerformed

    private void casillaUsuarioTxtActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_casillaUsuarioTxtActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_casillaUsuarioTxtActionPerformed

    /**
    * @param args the command line arguments
    */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new VistaAdministracion().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton borrarCasillaBtn;
    private javax.swing.JButton borrarConfianzaBtn;
    private javax.swing.JButton borrarOficinaBtn;
    private javax.swing.JButton borrarRelacBtn;
    private javax.swing.JButton borrarUsuarioBtn;
    private javax.swing.JLabel casillaLbl;
    private javax.swing.JLabel casillaRelacLbl;
    private javax.swing.JTextField casillaRelacTxt;
    private javax.swing.JTextField casillaTxt;
    private javax.swing.JLabel casillaUsuarioLbl;
    private javax.swing.JTextField casillaUsuarioTxt;
    private javax.swing.JPanel casillasPanel;
    private javax.swing.JPanel confianzasPanel;
    private javax.swing.JButton crearCasillaBtn;
    private javax.swing.JButton crearConfianzaBtn;
    private javax.swing.JButton crearOficinaBtn;
    private javax.swing.JButton crearRelacBtn;
    private javax.swing.JButton crearUsuarioBtn;
    private javax.swing.JTabbedPane jTabbedPane1;
    private javax.swing.JLabel oficina1Lbl;
    private javax.swing.JTextField oficina1Txt;
    private javax.swing.JLabel oficina2Lbl;
    private javax.swing.JTextField oficina2Txt;
    private javax.swing.JLabel oficinaLbl;
    private javax.swing.JLabel oficinaRelacLbl;
    private javax.swing.JTextField oficinaRelacTxt;
    private javax.swing.JTextField oficinaTxt;
    private javax.swing.JPanel oficinasPanel;
    private javax.swing.JLabel passLbl;
    private javax.swing.JPasswordField passTxt;
    private javax.swing.JPanel relacionesPanel;
    private javax.swing.JLabel usuarioLbl;
    private javax.swing.JTextField usuarioTxt;
    private javax.swing.JPanel usuariosPanel;
    // End of variables declaration//GEN-END:variables

}
